/*
DB Autobackuper plugin for Miranda IM

Copyright (C) 2005-2012 chaos.persei, sje, Kildor, Billy_Bons, Vasilich, Nikolay Raspopov

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

#pragma once

#define STRICT
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS

#define _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES 1
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
#define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT 1

#define ISOLATION_AWARE_ENABLED 1

#include "targetver.h"

#include "resource.h"

#include <windows.h>
#include <time.h>
#include <shlobj.h>
#include <shlwapi.h>

#pragma warning( push )
#pragma warning( disable : 4100 )
#pragma warning( disable : 4131 )
#pragma warning( disable : 4996 )

#include <zip.h>

#pragma warning( pop )

#pragma warning( push )
#pragma warning( disable : 4996 )

#define MIRANDA_VER 0x0A00

#ifdef _DEBUG
	#define DBCHECKSETTINGS
#endif

#include <m_stdhdr.h>
#include <newpluginapi.h>
#include <win2k.h>
#include <m_clist.h>
#include <m_plugins.h>
#include <m_system.h>
#include <m_database.h>
#include <m_langpack.h>
#include <m_utils.h>
#include <m_options.h>
#include <m_popup.h>
#include <m_icolib.h>

#include <m_folders.h>
#include <m_trigger.h>

#pragma warning( pop )

#include "version.h"

#define MS_AB_BACKUP		"AB/Backup"
#define MS_AB_BACKUPTRGR	"AB/Backuptrg"
#define MS_AB_SAVEAS		"AB/SaveAs"
#define SUB_DIR				_T("\\AutoBackups")
#define DIR					MIRANDA_USERDATAT

void ShowPopup(LPCTSTR szText, UINT nFlags = MB_ICONINFORMATION );
INT_PTR DBSaveAs(WPARAM wParam, LPARAM lParam);
INT_PTR ABService(WPARAM wParam, LPARAM lParam);
int CreateDirectoryTree(LPCTSTR szDir);
void BackupThread(void* backup_filename);
int Backup(LPCTSTR backup_filename);
int SetBackupTimer();
HWND CreateToolTip(HWND hwndParent, LPTSTR ptszText, LPTSTR ptszTitle);

extern HINSTANCE hInst;
extern HANDLE hFolder;

#ifdef _UNICODE
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#endif
